package com.acme.bankapp.domain.bank.account;

import com.acme.bankapp.domain.bank.client.Client;
import com.acme.bankapp.domain.bank.exception.DataIntegrityException;
import com.acme.bankapp.domain.bank.exception.NotEnoughFundsException;

/**
 * This interface declares account's functionality
 *
 * @author Alexander Kotov
 */

public interface Account {
    /**
     * @return double value that represents the account balance.
     */
    double getBalance();

    /**
     * This method for add amount to balance
     *
     * @param amount double value for add to balance
     */
    void deposit(double amount);

    /**
     * This method for decrease balance by amount
     *
     * @param amount double value
     */
    void withdraw(double amount) throws NotEnoughFundsException;

    /**
     * @return double value that represents maximum amount to withdraw.
     */
    double getMaximumAmountToWithdraw();

    /**
     * This method set connection between account and client objects
     */
    void connectWithClient(Client client) throws DataIntegrityException;
}
